package com.wanghengzhi.design.patterns.creational.factory;

/**
 * 使用工厂创建对象。
 * @author wanghengzhi
 * @since 2020.11.2
 */
public class ShapeDemo {
    public static void main(String[] args) {
        ShapeFactory shapeFactory = new ShapeFactory();
        Shape circle = shapeFactory.getShape("circle");
        Shape rectangle = shapeFactory.getShape("rectangle");
        Shape square = shapeFactory.getShape("square");
        circle.draw();
        rectangle.draw();
        square.draw();
    }
}
